<template>
  <div>
    <h2>Props传值：父的值是{{ count }}</h2>
    <Child :count="count" :changeCount="changeCount"></Child>
    <hr />
    <p>
      注释: <br />
      * props：父向子传递一个值，说明父传子<br />
      * props: 父向子传递一个函数,说明子传父<br />
    </p>
  </div>
</template>

<script>
import Child from "./Child";
export default {
  name: "Props",
  components: {
    Child,
  },
  data() {
    return {
      count: 0,
    };
  },
  methods: {
    changeCount(num) {
      this.count += num;
    },
  },
};
</script>

<style></style>
